import request from '../utils/requestContent'
const doudianBaseUrl = 'https://fxg.jinritemai.com/'


// 获取活动列表， 查找当前优惠券名称
export const getActivityListData = (param, tabid = '') => {
    return request({
        baseURL: doudianBaseUrl,
        url: `marketing/promotion/v1/listFlashWithTimeLimit`,
        method: "get",
        param: {
            _bid: 'ecom_market_shop',
            ...param
        }
    }, tabid)
}

/**
 * @name 获取商品suk信息
 * @param {入参} data 
 * @param {窗口id} tabid 
 * @returns 
 */
export const getActivitySkuListData = (data, tabid = '') => {
    return request({
        baseURL: doudianBaseUrl,
        url: `marketing/promotion/v1/batch_query_sku_list_v2`,
        method: "post",
        param: {
            _bid: 'ecom_market_shop'
        },
        data
    })
}
/**
 * 创建活动
 * @param {入参} data 
 * @param {窗口id} tabid 
 * @returns 
 */
export const cretedActivityApi = (data, tabid = '') => {
    return request({
        baseURL: doudianBaseUrl,
        url: `marketing/promotion/v1/createFlashAndGoods`,
        method: "post",
        param: {
            _bid: 'ecom_market_shop'
        },
        data
    })
}